import { guID } from "@/common.js" 
export const commonForm = [
  {
    id: guID(),
    isShow: true,
    type: 'input',
    /*标题*/
    label: "单行文本",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    unit: '', // 单位
    /*表单*/
    width: "",
    key: `input_${guID()}`,
    value: "",
    defaultValue: "",
    autoCalc: '',
    decimal: '',
    options: [],
    placeholder: "请输入",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'textarea',
    /*标题*/
    label: "多行文本",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key: `textarea_${guID()}`,
    value: "",
    defaultValue: "",
    options: [],
    placeholder: "请输入",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'radio',
    /*标题*/
    label: "单选",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    labelAlign: 'as',
    /*表单*/
    width: "",
    key1: `radio_${guID()}`,
    value1: "",
    key2: `radioOther_${guID()}`,
    value2:'',
    defaultValue: "",
    // isShowLink：是否显示关联   type：1禁用2启用  link：关联字段  isNeedOther: 是否需要更多
    options: [{id:'1', name:'选项1', isShowLink: false, type:'', link:'', isNeedOther: false }, {id:'2', name:'选项2', isShowLink: false, type: '', link: '', isNeedOther: false,}, {id:'3', name:'选项3', isShowLink: false, type: '', link: '', isNeedOther: false,}],
    optionsUrl: '', // 选项接口请求地址
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'checkbox',
    /*标题*/
    label: "多选",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key: `checkbox_${guID()}`,
    value: "",
    defaultValue: "",
    options: [{id:'1', name:'选项1'}, {id:'2', name:'选项2'}, {id:'3', name:'选项3'},],
    optionsUrl: '', // 选项接口请求地址
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'select',
    /*标题*/
    label: "下拉",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key1: `select_${guID()}`,
    value1: "",
    key2: `selectOther_${guID()}`,
    value2: "",
    defaultValue: "",
    // isShowLink：是否显示关联   type：1禁用2启用  link：关联字段
    options: [{id:'1', name:'选项1', isShowLink: false, type: '', link: '', isNeedOther: false }, {id:'2', name:'选项2', isShowLink: false, type: '', link: '', isNeedOther: false }, {id:'3', name:'选项3', isShowLink: false, type: '', link: '', isNeedOther: false }],
    optionsUrl: '', // 选项接口请求地址
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'date',
    /*标题*/
    label: "日期",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key: `date_${guID()}`,
    value: "",
    defaultValue: "",
    options: [],
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  // {
  //   id: guID(),
  //   isShow: true,
  //   type: 'dateRange',
  //   /*标题*/
  //   label: "日期范围",
  //   labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
  //   isLabelWidth: true,
  //   labelWidth: 90,
  //   /*表单*/
  //   width: "",
  //   key: `dateRange_${guID()}`,
  //   value: [],
  //   defaultValue: "",
  //   options: [],
  //   placeholder: "请选择",
  //   customClass: "",
  //   disabled: false,
  //   clearable: false,
  //   maxlength: 500,
  //   showWordLimit: false,
  //   /*校验*/
  //   required: false,
  //   validator: '() => {}',
  //   regExp: '/.*/',
  //   errmsg: '',
  //   /*事件*/
  //   onChange: '(e) => {}',
  //   onFocus: '(e) => {}',
  //   onBlur: '(e) => {}'
  // },
  {
    id: guID(),
    isShow: true,
    type: 'uploadFile',
    /*标题*/
    label: "上传文件",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key: `uploadFile_${guID()}`,
    limit: 1,
    value: [],
    uploadUrl: '', // 文件上传地址
    defaultValue: "",
    options: [],
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'uploadImg',
    /*标题*/
    label: "上传图片",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    /*表单*/
    width: "",
    key: `uploadImg_${guID()}`,
    limit: 1,
    value: [],
    defaultValue: "",
    options: [],
    placeholder: "请选择",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
  {
    id: guID(),
    isShow: true,
    type: 'currentAndTarget',
    /*标题*/
    label: "当前值/目标值",
    labelTextAlign: 0, // 0: 左对齐  1：居中   2：右对齐
    isLabelWidth: true,
    labelWidth: 90,
    unit: '', // 单位
    /*表单*/
    width: "",
    key1: `current`,
    key2: `target`,
    value1: "", // 当前值
    value2: "", // 目标值
    defaultValue: "",
    options: [],
    placeholder1: "当前值",
    placeholder2: "目标值",
    customClass: "",
    disabled: false,
    clearable: false,
    maxlength: 500,
    showWordLimit: false,
    /*校验*/
    required: false,
    validator: '() => {}',
    regExp: '/.*/',
    errmsg: '',
    /*事件*/
    onChange: '(e) => {}',
    onFocus: '(e) => {}',
    onBlur: '(e) => {}'
  },
]